Translatable
Classes that implement Translatable can be automatically utilized by many FzzyConfig systems for generating translatable text in-game
Author
fzzyhmstrs
Since
0.2.0, added prefixes 0.6.0
Samples
import me.fzzyhmstrs.fzzy_config.util.Translatable
fun main() {
//sampleStart
class ExampleTranslatable: Translatable {
override fun translationKey(): String {
return "my.config.cool.translation"
}
override fun descriptionKey(): String {
return "my.config.cool.translation.desc"
}
}
//sampleEnd
}Inheritors
Types
Description string for data generation or used as a "fallback" description implementation. Outputs in the lang file will have the suffix ".desc". Use this on the config class itself to translate the config description for a config screen button in the landing page.
Name string for data generation or used as a "fallback" name implementation. Use this on the config class itself to translate the config name.
Prefix string for data generation or used as a "fallback" name implementation. Outputs in the lang file will have the suffix ".prefix". Use this on the config class itself to translate the config prefix for a header and to put above a config screen button in the landing page.
Abstract representation of a translation result. Implementations of this class may or may not have all three translation components
Functions
The translated Text description from the descriptionKey. Falls back to an empty string so no tooltip is rendered.
translation key of this Translatable description. the "description" in-game, the descriptions Enchantment Descriptions adds to enchantment tooltips are a good example.
The translated Text description from the descriptionKey. Falls back to an empty string so no tooltip is rendered. If no translation exists when called returns null.
Whether this Translatable has a valid description
Whether this Translatable has a valid translation
The translated Text description from the descriptionKey. Falls back to an empty string so no tooltip is rendered.
The translated Text description from the descriptionKey. Falls back to an empty string so no tooltip is rendered. If no translation exists when called returns null.
The translated Text name from the translationKey. Falls back to the implementing classes Simple Name (non-translated)
translation key of this Translatable. the "name" in-game
The translated Text name from the translationKey. Falls back to the implementing classes Simple Name (non-translated). If no translation exists when called returns null.